<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <link rel="stylesheet" href="__STATIC__/layuimini/lib/layui-v2.6.3/css/layui.css" media="all">
    <title>Title</title>
</head>
<!--导航栏的style-->
<style>
    .main{
        height: calc( 100vh );
        display: flex;
        float: left;
    }
    .ulleft{
        height: 100%;
    }
    .logOff{
        position: fixed;
        bottom: -386px;
    }
</style>
<!--本页的style-->
<style>
    .ttt{
        position: fixed;
        top: 90px;
        left: 250px;
    }
    #ii{
        position: fixed;
        left: 200px;
        top: 0px;
    }</style>
<script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
<script src="__STATIC__/layuimini/lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
<script src="__STATIC__/layuimini/lib/jquery-3.4.1/jquery-3.4.1.min.js" charset="utf-8"></script>
<body>
        <img id="ii" src="../../../static/img/捕获.JPG" alt="">
        <!--导航栏   -->
        <div class="main"  style="width: auto;">
        <ul  id="test" class="ulleft  layui-nav layui-nav-tree" lay-filter="test">
        <!-- 侧边导航: <ul class="layui-nav layui-nav-tree layui-nav-side"> -->
        <li class="layui-nav-item"><a href="http://cmf.yeeyeeyjy.top/lunwen/stu_home">毕业设计管理系统</a></li>
        <li class="layui-nav-item"><a href="">用户：{$Think.session.stu_name}</a></li>
        <li class="layui-nav-item"><a href=""></a></li>
        <li class="layui-nav-item"><a href="http://cmf.yeeyeeyjy.top/lunwen/stu_submit_title" >提交课题</a></li>
        <li class="layui-nav-item"><a href="http://cmf.yeeyeeyjy.top/lunwen/stu_modify_title">修改课题</a></li>
        <li class="layui-nav-item"><a href="http://cmf.yeeyeeyjy.top/lunwen/stu_show_title">我的课题</a></li>
        <li class="layui-nav-item"><a href="http://cmf.yeeyeeyjy.top/lunwen/student_start_words">发起留言</a></li>
        <li class="logOff layui-nav-item"><a href="http://cmf.yeeyeeyjy.top/lunwen/login/loginOut">注销</a></li>
    </ul>
</div>
        <!--内容-->
        <table class="layui-table ttt">
            <colgroup>
                <col width="150">
                <col width="200">
                <col>
            </colgroup>
            <thead>
            <tr>
                <th>名称</th>
                <th>毕设标题</th>
                <th>状态</th>
                <th>时间</th>
                <th></th>
                <th></th>
                <th></th>
                <th></th>
            </tr>
            </thead>

            <tbody>
            <volist name="title" id="vo">
            <tr>
                <td>{$vo['stu_name']}</td>
                <td>{$vo['title']}</td>
                <td>{$vo['status']} </td>
                <td>{$vo['create_time']}</td>
                <td ></td>
                <td></td>
                <td></td>
                <td></td>
            </tr>
            </volist>
            </tbody>
        </table>
        <script>

            // function getHMS (timestamp) {
            //     var date = new Date(timestamp); //时间戳为10位需*1000，时间戳为13位的话不需乘1000
            //     var Y = date.getFullYear() + '/';
            //     var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '/';
            //     var D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()) + ' ';
            //
            //     var h = (date.getHours() < 10 ? '0' + (date.getHours()) : date.getHours()) + ':';
            //     var m = (date.getMinutes() < 10 ? '0' + (date.getMinutes()) : date.getMinutes()) + ':';
            //     var s = (date.getSeconds() < 10 ? '0' + (date.getSeconds()) : date.getSeconds());
            //     return Y + M + D + h + m + s;
            // }
            transformTime = (time,data) => {
                if (time) {
                    let date = new Date(time);
                    let y = date.getFullYear();
                    let M = date.getMonth() + 1;
                    let d = date.getDate();
                    let h = date.getHours();
                    let m = date.getMinutes();
                    let s = date.getSeconds();
                    if(data && data.toLowerCase() === 'yyyy-mm-dd'){
                        return `${y}-${addZero(M)}-${addZero(d)}`;
                    }else if(data && data.toLowerCase() === 'yyyy-mm-dd hh:mm:ss'){
                        return `${y}-${addZero(M)}-${addZero(d)} ${addZero(h)}:${addZero(m)}:${addZero(s)}`;
                    }else if(data && data.toLowerCase() === 'yyyy-mm-dd hh:mm'){
                        return `${y}-${addZero(M)}-${addZero(d)} ${addZero(h)}:${addZero(m)}`;
                    }else if(data === undefined){
                        return `${y}年${addZero(M)}月${addZero(d)}日 ${addZero(h)}:${addZero(m)}`;
                        // return `${y}年${addZero(M)}月${addZero(d)}日 ${addZero(h)}:${addZero(m)}:${addZero(s)}`;
                    }else if(data === '年月日'){
                        return `${y}年${addZero(M)}月${addZero(d)}日`;
                    }else if(data === '月'){
                        return `${addZero(M)}月`;
                    }else if(data === '年月'){
                        return `${y}年${addZero(M)}月`;
                    }else if(data === '月日 hh:mm'){
                        return `${addZero(M)}月${addZero(d)}日 ${addZero(h)}:${addZero(m)}`;
                    }else if(data === 'yyyy.mm.dd'){
                        return `${y}.${addZero(M)}.${addZero(d)}`;
                    }else{
                        console.log('data参数错误')
                        return;
                    }
                }
                else {
                    return '';
                }
            }
            function addZero(m) {
                return m < 10 ? `0${m}` : m;
            }
           function gettime(time){
               let timestr =  transformTime(time*1000,'yyyy-mm-dd hh:mm:ss')
                console.log(timestr);

               document.getElementById("qwe").innerHTML = timestr;
            }


        </script>
</body>
</html>